<?php
/**
 * Created by PhpStorm.
 * User: function
 * Date: 2018-05-02
 * Time: 18:23
 */

namespace app\admin\controller;

use app\common\controller\Admin;
use app\common\model\Withdraw as WithdrawModel;
use app\common\model\Company;
use app\common\model\Member;
use app\common\logic\Logic;

class Withdraw extends Admin
{
    public function index(){
        
        $logic = new Logic();
        $logic->setValue('modelClass','app\common\model\Withdraw');
        $logic->setValue('column','id,user_id,create_time,status');
        $logic->setValue('with','user,company,card');
        
        $params = paramForm();
        if (\think\Request::instance()->isAjax()) {
           
            $params['paginate'] = true;
//            if (isset($params['title'])){
//                $params['title'] = array('like','%'.$params['title'].'%');
//
//            }
//            if (isset($params['catname'])){
//                $catIds = Category::where('title','like','%'.$params['catname'].'%')->field('id')->select();
//
//                foreach ($catIds as $id){
//                    $tempArr[] = $id->id;
//                }
//                $params['catid'] = array('in',$tempArr);
//            }
            
            $lists = $logic->getList($params);
            success($lists);
        } else {
            return $this->fetch();
        }
        
    }
    
}